package DS0419;

public class main {
    public static void main(String args[]){

        //顺序表保存十个学生
        seqList student = new seqList();
        student.insert(new Student("鸣人","男"));
        student.insert(new Student("佐助","女"));
        student.insert(new Student("卡卡西","男"));
        student.insert(new Student("迈特凯","女"));
        student.insert(new Student("再不斩","男"));
        student.insert(new Student("水无月白","女"));
        student.insert(new Student("宇智波鼬","男"));
        student.insert(new Student("干柿鬼鲛","女"));
        student.insert(new Student("出云","男"));
        student.insert(new Student("子铁","女"));
        student.display();
        //创建顺序队列和链队列
        NodeQueue girl = new NodeQueue();
        sedQueue boy = new sedQueue();
        girl.initQueue();
        for(int i =0;i<student.length();i++) {
            if (student.getSex(i).equals("男")) {
                boy.enQueue(student.top(i));
            }
            if(student.getSex(i).equals("女")){
                girl.enQueue(student.top(i));
            }
        }
        //测试是否分别成功
        /*boy.display();
        girl.display();*/
        int leng = student.length()/2;
        for(int j =0;j<leng;j++){
            System.out.println(boy.element()+"和"+girl.element()+"永久成为美好的基佬");
            boy.delQueue();
            girl.delQueue();
            System.out.println();
        }






        //测试链式对列
        /*NodeQueue nodeQueue = new NodeQueue();
        nodeQueue.enQueue(new Student("a","男"));
        nodeQueue.enQueue(new Student("b","nv "));
        nodeQueue.display();
        nodeQueue.delQueue();
        nodeQueue.display();*/


        //测试循环队列
        /*LoopQueue loopQueue = new LoopQueue();
        loopQueue.enQueue("a");
        loopQueue.enQueue("b");
        loopQueue.enQueue("c");
        loopQueue.enQueue("d");
        loopQueue.enQueue("e");
        loopQueue.enQueue("f");

        loopQueue.display();
        loopQueue.delQueue();
        loopQueue.display();
        loopQueue.enQueue("f");
        loopQueue.display();
*/

    }
}
